<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<div id="app">
			<ul>
				没有加key
				<li v-for="a in arr">
				<input type="checkbox"/>{{a}}</li>
				<button type="button" @click="add">添加</button>
			</ul>
			<hr >
			<ul>
				有加key
				<li v-for="(a,index) in arr" :key="a">
				<input type="checkbox"/>{{a}}</li>
				<button type="button" @click="add">添加</button>
			</ul>
		</div>
		<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js"></script>
		<script type="text/javascript">
			var vm=new Vue({
				el:"#app",
				data:{
					arr:["a","b","c","d","e"]
				},
				methods:{
					add(){
						// this.arr.push()	
						this.arr.splice(2,0,"f")
					}
				}
			})
		</script>
	</body>
</html>
